From 187f27837a331675d322a2065745dfeab4ec501e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 15 Apr 2026 23:24:25 +0200 Subject: [PATCH] dash: Use connectObject to track signal connection to global objects While the dash is never destroyed in vanilla gnome shell, various extensions (such as dash-to-dock) are using this code, potentially for every monitor. And so we should make sure that the signals are disconnected when the actor is destroyed. Part-of: --- js/ui/dash.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/ui/dash.js b/js/ui/dash.js index 1a0a84142..970bf9400 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -378,10 +378,13 @@ export const Dash = GObject.registerClass({ this._workId = Main.initializeDeferredWork(this._box, this._redisplay.bind(this)); this._appSystem = Shell.AppSystem.get_default(); + this._appSystem.connectObject( + 'installed-changed', () => this._queueRedisplay(), + 'app-state-changed', () => this._queueRedisplay(), + this); - this._appSystem.connect('installed-changed', () => this._queueRedisplay()); - AppFavorites.getAppFavorites().connect('changed', this._queueRedisplay.bind(this)); - this._appSystem.connect('app-state-changed', this._queueRedisplay.bind(this)); + AppFavorites.getAppFavorites().connectObject('changed', + () => this._queueRedisplay(), this); Main.overview.connectObject( 'item-drag-begin', () => this._onItemDragBegin(), -- 2.39.5